{% load i18n %}
{% load staticfiles %}

<!DOCTYPE html>
<html lang="en">
	<head>
		<meta charset="utf-8" />
		<title></title>
		<meta name="description" content="overview & stats" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0" />
		<link href="/static/css/bootstrap.min.css" rel="stylesheet" />
		<link href="/static/css/bootstrap-responsive.min.css" rel="stylesheet" />
		<link rel="stylesheet" href="/static/css/font-awesome.min.css" />
		<!-- 下拉框 -->
		<link rel="stylesheet" href="/static/css/chosen.css" />
		
		<link rel="stylesheet" href="/static/css/ace.min.css" />
		<link rel="stylesheet" href="/static/css/ace-responsive.min.css" />
		<link rel="stylesheet" href="/static/css/ace-skins.min.css" />
		
		<link rel="stylesheet" href="/static/css/datepicker.css" /><!-- 日期框 -->
		<script type="text/javascript" src="/static/js/jquery-1.7.2.js"></script>
		<script type="text/javascript" src="/static/js/jquery.tips.js"></script>
		<script type="text/javascript" src="/static/js/bootbox.min.js"></script><!-- 确认窗口 -->
		<script type="text/javascript" src="/static/js/jquery.form.js"></script>
		<script type="text/javascript" src="/static/js/base.js"></script>
		<style type="text/css">
			.checkbox.inline input[type="checkbox"]{
				opacity:0.8!important;
			}
		</style>
<script type="text/javascript">
	
	
	//保存
	function save(){
		var id = $("#id_id").val();
		var title = $("#id_title").val();
		var keywords = $("#id_keywords").val();
		var description = $("#id_description").val();
		var copyright = $("#id_copyright").val();
		var icp = $("#id_icp").val();
		var address = $("#id_address").val();
		var email = $("#id_email").val();
		var phone = $("#id_phone").val();
		var service1name = $("#id_service1name").val();
		var service1phone = $("#id_service1phone").val();
		var service2name = $("#id_service2name").val();
		var service2phone = $("#id_service2phone").val();
		var service3name = $("#id_service3name").val();
		var service3phone = $("#id_service3phone").val();
		$.ajax({
			type: "post",
			url: '/main/web_config_page_save',
	    	data: {id:id,title:title,keywords:keywords,description:description,copyright:copyright,
	    		icp:icp,address:address,email:email,phone:phone,service1name:service1name,service1phone:service1phone,
	    		service2name:service2name,service2phone:service2phone,service3name:service3name,service3phone:service3phone,tm:new Date().getTime()},
			dataType:'json',
			cache: false,
			success: function(data){
				 if("success" == data.result){
					 alert("网站配置修改成功！");
					 window.location.href="/main/web_config_page";
				 }else{
					 alert("网站配置修改失败，请重试！");
					 return false;
				 }
			}
		});
	
	}
</script>
	</head>
<body>
 
	<form action="/main/web_config_page_save" name="Form" id="Form" method="post"  enctype="multipart/form-data">
		{% csrf_token %}
		<input id="id_id" name="id" type="hidden" value="{{webconfig.id|default_if_none:''}}"/>
		
		<div id="zhongxin">
		<table id="table_report" class="table table-striped table-bordered table-hover">
			<tr>
				<td style="width:90px;text-align: right;padding-top: 13px;">网站名称：</td>
				<td><input style="width:250px;" id="id_title" name="title" type="text" value="{{webconfig.title|default_if_none:''}}" maxlength="64" placeholder="这里输入网站名称" title="网站名称"/></td>
				<td colspan=2></td>
			</tr>
			<tr>
				<td style="width:90px;text-align: right;padding-top: 13px;">网站关键词：</td>
				<td><input style="width:95%;" id="id_keywords" name="keywords" type="text" value="{{webconfig.keywords|default_if_none:''}}" maxlength="100" placeholder="这里输入网站关键词" title="网站关键词"/></td>
				<td colspan=2>设置Meta标签的关键字，用英文逗号分隔</td>
			</tr>
			<tr>
				<td style="width:90px;text-align: right;padding-top: 13px;">网站描述：</td>
				<td><textarea style="width:95%;height:100px;" rows="8" cols="10" name="description" id="id_description" title="网站描述" maxlength="140" placeholder="这里输入网站描述">{{webconfig.description|default_if_none:""}}</textarea></td>
				<td colspan=2>设置Meta标签的描述信息</td>
			</tr>
			<tr>
				<td style="width:90px;text-align: right;padding-top: 13px;">网站logo：</td>
				<td><input style="width:95%;" id="id_logoimg" name="logoimg" type="text" value="{{webconfig.logoimg.name|default_if_none:''}}" maxlength="100"/></td>
				<td colspan=2><a class="btn btn-mini btn-info" onclick="imgupload({{webconfig.id}},'1');">点击上传</a> 尺寸：111*1111</td>
			</tr>
			<tr>
				<td style="width:90px;text-align: right;padding-top: 13px;">微信二维码：</td>
				<td><input style="width:95%;" id="id_wechatimg" name="wechatimg" type="text" value="{{webconfig.wechatimg.name|default_if_none:''}}" maxlength="100"/></td>
				<td colspan=2><a class="btn btn-mini btn-info" onclick="imgupload({{webconfig.id}},'2');">点击上传</a>尺寸：111*1111</td>
			</tr>
			<tr>
				<td style="width:90px;text-align: right;padding-top: 13px;">版权信息：</td>
				<td><input style="width:95%;" id="id_copyright" name="copyright" type="text" value="{{webconfig.copyright|default_if_none:''}}" maxlength="100" placeholder="这里输入版权信息" title="版权信息"/></td>
				<td colspan=2></td>
			</tr>
			<tr>
				<td style="width:90px;text-align: right;padding-top: 13px;">ICP备案序号：</td>
				<td><input style="width:95%;" id="id_icp" name="icp" type="text" value="{{webconfig.icp|default_if_none:''}}" maxlength="100" placeholder="这里输入ICP备案序号" title="ICP备案序号"/></td>
				 
				<td style="width:90px;text-align: right;padding-top: 13px;">地址：</td>
				<td><input style="width:95%;" id="id_address" name="address" type="text" value="{{webconfig.address|default_if_none:''}}" maxlength="100" placeholder="这里输入地址" title="地址"/></td>
			</tr>
			<tr>
				<td style="width:90px;text-align: right;padding-top: 13px;">邮箱：</td>
				<td><input style="width:95%;" id="id_email" name="email" type="text" value="{{webconfig.email|default_if_none:''}}" maxlength="100" placeholder="这里输入邮箱" title="邮箱"/></td>
				
				<td style="width:90px;text-align: right;padding-top: 13px;">热线电话：</td>
				<td><input style="width:95%;" id="id_phone" name="phone" type="text" value="{{webconfig.phone|default_if_none:''}}" maxlength="100" placeholder="这里输入热线电话" title="热线电话"/></td>
			</tr>
			<tr>
				<td style="width:90px;text-align: right;padding-top: 13px;">在线客服1名称：</td>
				<td><input style="width:250px;" id="id_service1name" name="service1name" type="text" value="{{webconfig.service1name|default_if_none:''}}" maxlength="100" placeholder="这里输入在线客服1名称" title="在线客服1名称"/></td>
				
				<td style="width:90px;text-align: right;padding-top: 13px;">在线客服1联系方式：</td>
				<td><input style="width:250px;" id="id_service1phone" name="service1phone" type="text" value="{{webconfig.service1phone|default_if_none:''}}" maxlength="100" placeholder="这里输入在线客服1联系方式" title="在线客服1联系方式"/></td>
			</tr>
			<tr>
				<td style="width:90px;text-align: right;padding-top: 13px;">在线客服2名称：</td>
				<td><input style="width:250px;" id="id_service2name" name="service2name" type="text" value="{{webconfig.service2name|default_if_none:''}}" maxlength="100" placeholder="这里输入在线客服1名称" title="在线客服1名称"/></td>
				
				<td style="width:90px;text-align: right;padding-top: 13px;">在线客服2联系方式：</td>
				<td><input style="width:250px;" id="id_service2phone" name="service2phone" type="text" value="{{webconfig.service2phone|default_if_none:''}}" maxlength="100" placeholder="这里输入在线客服1联系方式" title="在线客服1联系方式"/></td>
			</tr>		
			<tr>
				<td style="width:90px;text-align: right;padding-top: 13px;">在线客服3名称：</td>
				<td><input style="width:250px;" id="id_service3name" name="service3name" type="text" value="{{webconfig.service3name|default_if_none:''}}" maxlength="100" placeholder="这里输入在线客服1名称" title="在线客服1名称"/></td>
				
				<td style="width:90px;text-align: right;padding-top: 13px;">在线客服3联系方式：</td>
				<td><input style="width:250px;" id="id_service3phone" name="service3phone" type="text" value="{{webconfig.service3phone|default_if_none:''}}" maxlength="100" placeholder="这里输入在线客服1联系方式" title="在线客服1联系方式"/></td>
			</tr>
			<tr>
				<td style="text-align: center;" colspan="10">
					<a class="btn btn-mini btn-primary" onclick="save();">保存</a>
					<a class="btn btn-mini btn-danger" onclick="top.Dialog.close();">取消</a>
				</td>
			</tr>
		</table>
		</div>
		
		<div id="zhongxin2" class="center" style="display:none"><br/><br/><br/><br/><br/><img src="/static/images/jiazai.gif" /><br/><h4 class="lighter block green">提交中...</h4></div>
		
	</form>
	
	
		<!-- 引入 -->
		<script type="text/javascript">window.jQuery || document.write("<script src='static/js/jquery-1.9.1.min.js'>\x3C/script>");</script>
		<script src="/static/js/bootstrap.min.js"></script>
		<script src="/static/js/ace-elements.min.js"></script>
		<script src="/static/js/ace.min.js"></script>
		<script type="text/javascript" src="/static/js/chosen.jquery.min.js"></script><!-- 下拉框 -->
		<script type="text/javascript" src="/static/js/bootstrap-datepicker.min.js"></script><!-- 日期框 -->
		<script type="text/javascript">
		$(top.hangge());
		$(function() {
			//单选框
			$(".chzn-select").chosen(); 
			$(".chzn-select-deselect").chosen({allow_single_deselect:true}); 
			
			 
		});
		
		</script>
</body>
</html>